package cn.js.sangu.unitStore.entity;

import cn.hutool.core.annotation.Alias;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 说明：设备表
 * 作者：linshuo
 * 日期：2024/8/7 9:10
 */

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@TableName("device")
public class Device {
    @TableId(type = IdType.AUTO)
    private Integer id;
    @Alias("设备名称") //Hutool工具用于标识字段中文名
    private String deviceName;
    @Alias("密码")
    private String password;
    @Alias("账号")
    private String account;

    @Alias("创建时间")
    @TableField(fill = FieldFill.INSERT)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
    private Date creatTime;

    @Alias("更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
    private Date updateTime;

    @Alias("数据状态")
    private Integer state;

    @Alias("电脑状态")
    private Integer computer;

    @Alias("用户id")
    private Integer userId;
}
